home *** CD-ROM | disk | FTP | other *** search
- Path: news.netvision.net.il!usenet
- From: simchoni@netvision.net.il (Ami Simchoni)
- Newsgroups: comp.lang.c
- Subject: Q.: How does strtol() handles overflows?
- Date: 9 Jan 1996 18:27:29 GMT
- Organization: Simchoni Automation Systems Ltd
- Message-ID: <4cuc2h$gup@news.netvision.net.il>
- NNTP-Posting-Host: ts4cp13.netvision.net.il
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
- Hi,
-
- I am trying to make a rubust ascii-to-decimal function which handles
- input errors and overflows. I want to rely on the standard library as
- much as possible.
-
- Borland C++ 3.1 and 4.02 doumentation says if an overflow occurs strtol
- just returns zero - which is not satisfactory, of course.
-
- The BC++3.1 library source which I have, however, sets errno to ERANGE
- and returns LONG_MIN or LONG_MAX on overflow. This appears both in the
- code and in the comments.
-
- Does anybody know what the standard says about it?
-
- Thanks,
- Uri.
-
-